<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
function delay(time,fn){
    return new Promise((resovle,reject)=>{
        setTimeout(()=>{
            fn();
            resovle("完成");
        },time);
    });
} 
async function fn(){
    let val = await delay(1000,function(){
        console.log(1);
    });
    console.log(val);
    let val2 = await delay(1000,function(){
        console.log(2);
    });
    let val3 = await  delay(1000,function(){
        console.log(3);
    });
}
fn();    
</script>    
</body>
</html>